#include<iostream>
using namespace std;
int main()
{   
    void read_number(int *arry,int number);
    int search(int *arry,int number);
    cout<<"How many number you want to enter:"<<endl;
    int number;
    cin>>number;
    int arry[number];
    read_number(arry,number);
    int n=search(arry,number);
    if(n==-1) cout<<"Sorry we not find the number"<<endl;
    else cout<<"The position is"<<n+1<<endl;
    system("pause");
}
void read_number(int *arry,int number)
{
    cout<<"Please enter "<<number<<" number."<<endl;
    for(int i=0;i<number;i++)
    {
        cin>>arry[i];
    }
}
int search(int *arry,int number)
{
    cout<<"Please enter you want to look:"<<endl;
    int m;
    cin>>m;
    int low=0,high=number-1,mid;
    while (mid <= high)
    {
       mid=(low+high)/2;
       if(arry[mid]==m) return mid;
       else if(arry[mid]<m) low=mid+1;
        else{
            high=mid-1;
        }
    }
    return -1;
}